import React from "react";

interface IProps {
  name: string;
  change: () => void;
}

class Hello extends React.PureComponent<IProps> {
  render(): React.ReactNode {
    console.log("Hello Render");
    return (
      <div>
        <p>Hello, {this.props.name}</p>
        <button onClick={this.props.change}>通知父组件修改姓名</button>
      </div>
    );
  }
}
export default Hello;
